#include <string.h>
#include <sdcc-lib.h>

#if !_SDCC_PORT_PROVIDES_STRCMP

int strcmp( const char * asrc, const char * adst ) {
  #if _SDCC_Z80_STYLE_LIB_OPT
#pragma noinduction
  char ret = 0;
  const char * src = asrc;
  const char * dst = adst;
  while( !( *src - *dst ) && *dst ) {
    ++src, ++dst;
  }
  return *src - *dst;
  #else
  register int ret = 0;
  while( !( ret = *( unsigned char * )asrc - * ( unsigned char * )adst ) && *adst ) {
    ++asrc, ++adst;
  }
  return( ret );
  #endif
}

#endif
